<template>
	<view class="content">
		<view>{{title}}</view>
		<rich-text :nodes="contexttext"></rich-text>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				contexttext:'',
				token: '',
				title: '',
				id:''
			}
		},
		onShow() {
			this.$msgchat.initwork();
		},
		onLoad(option) {
			this.token = uni.getStorageSync('token');
			this.id = option.id
			// if(option.id == 1){
			// 	uni.setNavigationBarTitle({
			// 		title: '发送朋友圈失败怎么办'
			// 	})
			// 	this.title = '发送朋友圈失败怎么办?'
			// }else if(option.id ==2 ){
			// 	uni.setNavigationBarTitle({
			// 		title: '一件克隆如何使用'
			// 	})
			// 	this.title = '一件克隆如何使用?'
			// }else if(option.id == 3){
			// 	uni.setNavigationBarTitle({
			// 		title: '支付相关问题'
			// 	})
			// 	this.title = '支付相关问题'
			// }
			this.initDat();
		},
		methods:{
			//初始化数据
			initDat(){
				this.$common.requests('/api/Problem/problemdetail',{id:this.id}).then(res => {
					if(res.data.code == 1){
						uni.setNavigationBarTitle({
								title: res.data.data.title
							})
						this.title = res.data.data.title;
						this.contexttext = res.data.data.content;
					}
				})
			}
		}
	}
</script>

<style >
	.t-title{
		text-align: center;
		font-size: 20px;
		font-weight: bold;
		color: #000;
		letter-spacing: 3upx;
	}
	.content{
		padding: 20upx 30upx;
	}
	.t-context{
		margin: 20upx 25upx;
		font-size: 17px;
		line-height: 30px;
		letter-spacing: 3upx;
		text-indent: 38px;
		color: #606266;
	}
</style>
